<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>

<body>



    <div id="app">
        <h3>商品列表</h3>
        <div>user:{{user}}</div>
        <div>一级分类：
            <select v-model="user.first_cateid">
                <option value="" disabled>--请选择--</option>
                <option v-for="item in dianqi" :key="item.id":value="item.id">{{item.name}}</option>
            </select>
        </div>

        <div>二级分类：
            <select v-model="user.second_cateid">
                <option value="" disabled>--请选择--</option>
                <option v-for="item in meizhuang" :value="item.name">{{item.name}}</option>
            </select>
        </div>

        <div>商品名称:<input type="text" v-model="user.goodsname">{{user.goodsname}}</input></div>
        <div>价格:<input type="text"  v-model="user.price">{{user.price}}</input></div>
        <div>市场价格:<input type="text"  v-model="user.market_price">{{user.market_price}}</input></div>

        <div>商品规格：
            <select v-model="user.specsid">
                <option value="" disabled>--请选择--</option>
                <option v-for="item in guige" :key="item.id" :value="item.id">{{item.name}}</option>
            </select>
        </div>

        <div>规格属性：
            <select multiple v-model="user.specsattr" >
                <option value="" disabled >--请选择--</option>
                <option v-for="item in yanse" :key="item.id" :value="item.name">{{item.name}}</option>
            </select>
        </div>

        <div>是否新品：
            <label>
                <input type="radio" v-model="user.isnew" value="1" name="sex">是
            </label>
            <label>
                <input type="radio"  v-model="user.isnew" value="0" name="sex">否
            </label>
        </div>


        <div>是否热卖：
            <label>
                <input type="radio" v-model="user.ishot"  value="1" name="nn">是
            </label>
            <label>
                <input type="radio" v-model="user.ishot" value="0" name="nn">否
            </label>
        </div>
       
        <div></div>

    </div>

    <script>
        new Vue({
            el: "#app",
            data: {
                //一级分类
                dianqi: [
                    {
                        id: 0,
                        name: "家用电器"
                    },
                    {
                        id: 1,
                        name: "美妆护肤"
                    },
                    {
                        id: 2,
                        name: "电子产品"
                    },
                ],
                meizhuang:[
                    {id:1,name:"精华"},
                    {id:2,name:"爽肤水"},
                    {id:3,name:"美容仪"},
                ],
                guige:[
                    {id:"0",name:"颜色"},
                    {id:"1",name:"大小"},
                    {id:"2",name:"尺寸"},
                ],
                yanse:[
                    {id:1,name:"红色"},
                    {id:2,name:"黄色"},
                    {id:3,name:"绿色"},
                ],
                user: {
                    first_cateid: "",
                    second_cateid: "",
                    goodsname: "",
                    price: "",
                    market_price: "",
                    specsid: "",
                    specsattr: [],
                    isnew: "",
                    ishot: "",
                    status: false,
                }

            },
            methods: {

            },
        })


    </script>
</body>

</html>